package com.bootdo.staticmask.dao;

import com.bootdo.staticmask.domain.MaskOracleDO;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 数据源
 * @author lkg
 * @email lkggod@163.com
 * @date 2018-04-25 11:27:35
 */
@Mapper
public interface MaskOracleDao {

	MaskOracleDO get(Integer oracleId);
	
	List<MaskOracleDO> list(Map<String,Object> map);
	
	int count(Map<String,Object> map);
	
	int save(MaskOracleDO maskOracle);
	
	int update(MaskOracleDO maskOracle);
	
	int remove(Integer oracle_id);
	
	int batchRemove(Integer[] oracleIds);

	@Select("select oracle_id as id, oracle_name as name, createtime from mask_oracle")
	List<Map<String, Object>> findNameAndIdAndCreatetime();

	@Select("select `oracle_name`,`oracle_ip`,`oracle_port`,`oracle_servicename`,`servicename_is`,`oracle_user`,`oracle_password` from mask_oracle where oracle_name = #{name}")
	MaskOracleDO findOneByName(@Param("name") String name);
}
